package ie.lawlor.amvc.example.explorer.folder;

import ie.lawlor.amvc.event.Event;
import ie.lawlor.amvc.swing.JPanelView;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;

import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;




/**
* This code was generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* *************************************
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED
* for this machine, so Jigloo or this code cannot be used legally
* for any corporate or commercial purpose.
* *************************************
*/
/**
 * @author blawlor
 *
 */
public class FolderView extends JPanelView {
	
	public static final String SLOT_ONE = "Slot One";
	public static final String SLOT_TWO = "Slot Two";

	public FolderView(String name){
		super(name);
		setLayout(new BorderLayout());
		setMinimumSize(new Dimension(200, 80));
		setMaximumSize(new Dimension(200, 80));
		setPreferredSize(new Dimension(200, 80));
		folderButtons = new JPanel();
		folderButtons.setLayout(new BoxLayout(folderButtons, BoxLayout.Y_AXIS));		
		add(BorderLayout.SOUTH, folderButtons);
		slotOne = new JPanel(new BorderLayout());
		folderButtons.add(slotOne);
		slotTwo = new JPanel(new BorderLayout());
		folderButtons.add(slotTwo);
		JLabel testLabel = new JLabel("Folders");
		add(BorderLayout.NORTH, testLabel);
	}
	
	public void doInitView(Event e){
	}
	
    /* (non-Javadoc)
     * @see com.spokesoft.hmvc.swing.SwingView#getContainer(java.lang.String)
     */
    public Container getContainer(String viewName) {
    	if (viewName.equals(SLOT_ONE)){
    		return slotOne;
    	} else if (viewName.equals(SLOT_TWO)){
    		return slotTwo;
    	}
    	return null;
    }

	private JPanel folderButtons = null;
	private JPanel slotOne;
	private JPanel slotTwo;
}
